﻿<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="dist/css/bootstrap.min.css">
<link rel="stylesheet" href="static/css/docs.min.css">
<link rel="stylesheet" href="static/css/github.css">

<script src="static/js/jquery.min.js"></script>
<script src="static/js/jquery.rotate.min.js"></script>
    <script src="dist/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="jquery.wheelOfFortune.js"></script>
<script type="text/javascript" src="static/js/dome.js"></script>
<script src="static/js/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<title>两款转盘抽奖</title>
    <style type="text/css">
        .row {
            margin-right: 9px;
            margin-left: 80px;
        }
        footer {
            border-top: 5px solid seagreen;
            border-bottom: 1px solid #333333;
            /*background-color: #00AA88;*/
            background-color: hsl(209, 51%, 92%);
        }
        .table {
            height: 503px;
        }

        .navbar-brand:hover {
            background-color: #00ccff;
            font-size: 20px;
        }

        .navbar-nav li:hover {
            background-color: #00ccff;
            font-size: 20px;
        }

        body {
            font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
            font-size: 14px;
            line-height: 1.42857143;
            color: #333;
            background-color: #FFE;
        }

        .table th {
            height: 20px
        }

        .table td {
            height: 20px;
        }

        #ccc {
            background-image: url("./static/img/980.png");
            /*background-repeat: no-repeat;*/
        }

    </style>
</head>
<body>
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/public/index.html">Go抽奖系统</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul id="nav_login" class="nav navbar-nav">
                <li><a href="/login">登录</a></li>
            </ul>
            <ul id="nav_logout" class="nav navbar-nav">
                <li><a href="/myprize">我的中奖纪录</a></li>

            </ul>
            <ul class="nav navbar-nav navbar-right">
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">更多 <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">Action</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="#">Separated link</a></li>
                    </ul>
                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>

<div id="ccc" class="container-fluid" style="margin-left: 25px;margin-right: 25px;">

    <div class="row" style="height: 585px;;">
        <div class="row">
            <div class="col-md-6">
                <div id="wheel_container"></div>
            </div>
            <div class="col-md-6">
                <div id="wheel_container2"></div>
            </div>
        </div>
    </div>

    <div class="row" style="display: none;">
        <div class="col-md-12">
            <h1 class="page-header"><a class="anchorjs-link "
                                       style="font-family: anchorjs-icons; font-style: normal; font-variant: normal; font-weight: normal; position: absolute; margin-left: -1em; padding-right: 0.5em;"></a>演示
            </h1>

            <div class="highlight"><pre>
                  <code>    build: function () {
        var that = DomeWebController;
        that.getEle("$wheelContainer").wheelOfFortune({
            'wheelImg': "static/img/wheel_1/wheel.png",                          //转轮图片
            'pointerImg': "static/img/wheel_1/pointer.png",                      //指针图片
            'buttonImg': "static/img/wheel_1/button.png",                        //开始按钮图片
            //'wSide': 400,                                                      //转轮边长(默认使用图片宽度)
            //'pSide': 191,                                                      //指针边长(默认使用图片宽度)
            //'bSide': 87,                                                       //按钮边长(默认使用图片宽度)
            'items': {2: [41, 128], 3: [129, 219], 4: [220, 310], 1: [311, 400]},//奖品角度配置{键:[开始角度,结束角度],键:[开始角度,结束角度],......}
            'pAngle': 270,                                                       //指针图片中的指针角度(x轴正值为0度，顺时针旋转 默认0)
            //'type': 'w',                                                       //旋转指针还是转盘('p'指针 'w'转盘 默认'p')
            //'fluctuate': 0.5,                                                  //停止位置距角度配置中点的偏移波动范围(0-1 默认0.8)
            //'rotateNum': 12,                                                   //转多少圈(默认12)
            //'duration': 6666,                                                  //转一次的持续时间(默认5000)
            'click': function () {
                var key = parseInt(Math.random() * 4) + 1;
                that.getEle("$wheelContainer").wheelOfFortune('rotate', key,'w');
            },                                                                  //点击按钮的回调
            'rotateCallback': function (key) {
                alert("啪:" + key);
            }                                                                   //转完的回调

        that.getEle("$wheelContainer2").wheelOfFortune({
            'wheelImg': "static/img/wheel_1/wheel.png",                          //转轮图片
            'pointerImg': "static/img/wheel_1/pointer.png",                      //指针图片
            'buttonImg': "static/img/wheel_1/button.png",                        //开始按钮图片
            //'wSide': 400,                                                      //转轮边长(默认使用图片宽度)
            //'pSide': 191,                                                      //指针边长(默认使用图片宽度)
            //'bSide': 87,                                                       //按钮边长(默认使用图片宽度)
            'items': {2: [41, 128], 3: [129, 219], 4: [220, 310], 1: [311, 400]},//奖品角度配置{键:[开始角度,结束角度],键:[开始角度,结束角度],......}
            'pAngle': 270,                                                       //指针图片中的指针角度(x轴正值为0度，顺时针旋转 默认0)
            //'type': 'w',                                                       //旋转指针还是转盘('p'指针 'w'转盘 默认'p')
            //'fluctuate': 0.5,                                                  //停止位置距角度配置中点的偏移波动范围(0-1 默认0.8)
            //'rotateNum': 12,                                                   //转多少圈(默认12)
            //'duration': 6666,                                                  //转一次的持续时间(默认5000)
            'click': function () {
                var key = parseInt(Math.random() * 4) + 1;
                that.getEle("$wheelContainer").wheelOfFortune('rotate', key);
            },                                                                  //点击按钮的回调
            'rotateCallback': function (key) {
                alert("啪:" + key);
            }                                                                   //转完的回调
        });
    }</code></pre>
            </div>
        </div>
    </div>

    <div class="row" style="display: none;">
        <div class="col-md-12">
            <h1 class="page-header"><a class="anchorjs-link "
                                       style="font-family: anchorjs-icons; font-style: normal; font-variant: normal; font-weight: normal; position: absolute; margin-left: -1em; padding-right: 0.5em;"></a>使用方法
            </h1>

            依赖 jquery 与 jquery.rotate<br>
            组件需要一个容器元素，组件将在容器中生成转盘元素<br>
            <div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">
                <p>适用浏览器：360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗. 不支持IE8及以下浏览器。</p>
                <p>来源：<a href="http://sc.chinaz.com/" target="_blank">站长素材</a></p>
            </div>
            <h2>初始化:</h2>

            <div class="highlight"><pre>
                  <code> $(xxx).wheelOfFortune({
    'wheelImg':,//转轮图片
    'pointerImg':,//指针图片
    'buttonImg':,//开始按钮图片
    'wSide':,//转轮边长(默认使用图片宽度)
    'pSide':,//指针边长(默认使用图片宽度)
    'bSide':,//按钮边长(默认使用图片宽度)
    'items':,//奖品角度配置{键:[开始角度,结束角度],键:[开始角度,结束角度],......}
    'pAngle':,//指针图片中的指针角度(x轴正值为0度，顺时针旋转 默认0)
    'type':,//旋转指针还是转盘('p'指针 'w'转盘 默认'p')
    'fluctuate':,//停止位置距角度配置中点的偏移波动范围(0-1 默认0.8)
    'rotateNum':,//转多少圈(默认12)
    'duration':,//转一次的持续时间(默认5000)
    'click':,//点击按钮的回调
    'rotateCallback'/转完的回调
 });</code></pre>
            </div>

            <h2>转到目标奖项:</h2>

            <div class="highlight"><pre>
                  <code> $(xxx).wheelOfFortune('rotate',key,type);
    //'rotate':调用转方法
    //key:初始化中items的键
    //type:旋转指针还是转盘('p'指针 'w'转盘) 优先于初始化的type</code></pre>
            </div>
        </div>
    </div>


</div>

<div class="bs-docs-header" id="content" tabindex="-1" style="display: none;">
    <div class="container">
        <h1>jquery.wheelOfFortune</h1>

        <p>转盘组件</p>
    </div>
</div>

<script src="dist/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<script>
    var uid = 0;
    var username = "";
    var login = $.cookie('lottery_loginuser')
    if (login && login.length > 1) {
        var datas = login.split("&")
        for(var i = 0; i < datas.length; i++) {
            var data = datas[i].split("=");
            if (data[0] == "uid") {
                uid = data[1] - 0;
            } else if (data[0] == "username") {
                username = data[1];
            }
        }
        console.log(uid + " " + username)
    }

        $("#nav_login").hide();

</script>
<footer style="text-align: center;">
    <center>
        <table  width="640" border="0">
            <tr class="tt">
                <td align="center" width="80"><a href="#"><font size="1"><b>关于我们&nbsp;&nbsp;&nbsp;&nbsp;|</b></font></a></td>
                <td align="center" width="80"><a href="#"><font size="1"><b>About&nbsp;&nbsp;&nbsp;&nbsp;|</b></font></a></td>
                <td align="center" width="80"><a href="#"><font size="1"><b>服务协议&nbsp;&nbsp;&nbsp;&nbsp;|</b></font></a></td>
                <td align="center" width="80"><a href="#"><font size="1"><b>隐私政策 &nbsp;&nbsp;&nbsp;&nbsp;|</b></font></a></td>
                <td align="center" width="80"><a href="#"><font size="1"><b>开放平台&nbsp;&nbsp;&nbsp;&nbsp;|</b></font></a></td>
                <td align="center" width="80"><a href="#"><font size="1"><b>商务洽谈&nbsp;&nbsp;&nbsp;&nbsp;|</b></font></a></td>
                <td align="center" width="80"><a href="#"><font size="1"><b>招聘&nbsp;&nbsp;&nbsp;&nbsp;|</b></font></a></td>
                <td align="center" width="80"><a href="#"><font size="1"><b>客服中心&nbsp;&nbsp;&nbsp;&nbsp;</b></font></a></td>
            </tr>
        </table>
        <p><font size="1"><b>&copy;2022 - Go抽奖系统：&copy;:版权所有，计科三班，黄栋林</b></font></p>
        <address>E-mail:  huangdonglin@qq.com</address>
    </center>
</footer>
</body>
</html>